#include "Shm.hpp"
#include "FIFO.hpp"

int main()
{

    FileOper writefile(".", "FIFO");
    writefile.OpenForWrite();

    Shm shm(gpath, gproj_id, USER);
    char *p = (char *)shm.VirtualAdd();
    sleep(1);
    //向共享内存中写入数据"i am process A"
    strcpy(p, "i am process A");
    writefile.Wakeup();
    /* int index = 0;
    for (char c = 'a'; c <= 'z'; c++, index += 2)
    {
        sleep(1);
        p[index] = c;
        p[index + 1] = c;
        sleep(1);
        p[index + 2] = '\0';

        writefile.Wakeup();
    } */

    writefile.Close(); // 关闭管道文件
    return 0;
}